package com.jlpay.openapi.demo.ledger.merchconf;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.MerchIssueQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.MerchIssueQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class MerchIssueQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MerchIssueQueryService.class);

    public static void main(String[] args) {
        MerchIssueQueryRequest merchIssueQueryRequest = buildMerchIssueQueryRequest();
        MerchIssueQueryResponse merchIssueQueryResponse = JlpayOpenApiService.openMerchService()
                .post(merchIssueQueryRequest, MerchIssueQueryResponse.class);
        LOGGER.info("分账配置分账业务规则查询响应:{}", JsonUtils.toString(merchIssueQueryResponse));
    }

    private static MerchIssueQueryRequest buildMerchIssueQueryRequest() {
        MerchIssueQueryRequest merchIssueQueryRequest = new MerchIssueQueryRequest();
        merchIssueQueryRequest.setOrgCode("50720711");
        merchIssueQueryRequest.setMchId("849581183510017");
        return merchIssueQueryRequest;
    }
}
